<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">


    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('* 员工工号')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-invite" data-rule="required" class="form-control" name="row[invite]" type="text">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('* 商品ID')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-goods_sn" data-rule="required" class="form-control" onkeyup="search()" name="row[goods_sn]" type="text">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('游戏名称')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-gamename" class="form-control" readonly name="row[gamename]" type="text">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('游戏区服')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-plat_id" class="form-control" readonly name="row[plat_id]" type="text" value="">
        </div>
    </div>
<!--    <div class="form-group">-->
<!--        <label class="control-label col-xs-12 col-sm-2">{:__('录入方式')}:</label>-->
<!--        <div class="col-xs-12 col-sm-8">-->
<!--            <div class="radio">-->
<!--                <label><input type="radio" name="row[type]" checked value="1" />卖家信息</label>-->

<!--                <label><input type="radio" name="row[type]" value="2" />聊天记录</label>-->
<!--            </div>-->
<!--        </div>-->
<!--    </div>-->
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('卖家手机号')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-mobile" class="form-control" name="row[mobile]" type="text" value="">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('卖家QQ号')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-qq" class="form-control" name="row[qq]" type="text" value="">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('游戏账号')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-g_account" class="form-control" name="row[g_account]" type="text" value="">
        </div>
    </div>


    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-success btn-embossed">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>
<script>
    function search() {
        var order_sn = $("#c-goods_sn").val();
        var url = "extension/goods/search";
        $.ajax({
            type:'get',
            url:url,
            data:"order_sn="+order_sn,
            success:function(res){
                var result = JSON.parse(res);
                console.log(result.gamename)
                console.log(result.server)
                $("#c-gamename").val(result.gamename)
                $("#c-plat_id").val(result.server)
            }
        })
    }

</script>
